package com.example.jetpacktest.viewmodel

import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class Test005ViewModel : ViewModel() {

    private val TAG: String = this.javaClass.simpleName

    val count: MutableLiveData<Int> = MutableLiveData(10)

    fun inc(){
        Log.d(TAG, "inc()调用了.........")
        count.value = count.value?.inc()

    }

    fun dec(){
        Log.d(TAG, "dec()调用了.........")
        count.value = count.value?.dec()
    }

}